# -*- coding: utf8 -*-
import unittest
from human import Player
from human import Enemy
from tmap import Map

class MapTest(unittest.TestCase):
    def setUp(self):
        self.ppl=Player(mhp=10,hp=10)
        self.enemy=Enemy(mhp=8,hp=8)
        self.newmap=Map([[0,0,0,self.ppl],
                    [0,0,0,0],
                    [0,0,0,0],
                    [self.enemy,0,0,0]])
    def test_Fly(self):
        print (self.newmap.getPosition(self.ppl))
        print 'Fly_Start'
        self.newmap.missionStart()
        self.newmap.mapRoundStart(flug='hero')
        self.assertEqual(self.newmap.fly(self.ppl,2,3),(2,3))
        print 'Hero Flew Over'
        print '#### Waiting For Enemy   ####'
        print '#### Enemy Start !!!     ####'
        self.assertEqual(self.newmap.fly(self.enemy,3,1),(False))
        print '###  Enemy Flew Over!!   ####'
        self.newmap.mapRoundStart(flug='enemy')
        print (self.newmap.getPosition(self.enemy))
        print (self.newmap.getPosition(self.ppl))
if __name__ == '__main__':
    unittest.main()
